package cn.edu.sgu.www.mhxysy.dto.equipment;

import cn.edu.sgu.www.mhxysy.consts.CustomMessages;
import cn.edu.sgu.www.mhxysy.consts.RegExps;
import cn.edu.sgu.www.mhxysy.dto.DataTransferObject;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.*;

/**
 * @author 沐雨橙风ιε
 * @version 1.0
 */
@Data
@ApiModel
public class EquipmentDTO implements DataTransferObject {

    @ApiModelProperty(value = "ID")
    private String id;

    /**
     * 装备评分
     */
    @Positive(message = "装备评分" + CustomMessages.ILLEGAL)
    @NotNull(message = "装备评分" + CustomMessages.NOT_NULL)
    @ApiModelProperty(value = "装备评分", required = true)
    private Integer score;

    /**
     * 打造者
     */
    @NotBlank(message = "打造者" + CustomMessages.NOT_NULL)
    @ApiModelProperty(value = "打造者", required = true)
    private String forger;

    /**
     * 耐久度
     */
    @PositiveOrZero(message = "耐久度" + CustomMessages.ILLEGAL)
    @NotNull(message = "耐久度" + CustomMessages.NOT_NULL)
    @ApiModelProperty(value = "耐久度", required = true)
    private Integer durability;

    /**
     * 修理失败次数
     */
    @Range(min = 0, max = 3, message = "修理失败次数" + CustomMessages.ILLEGAL)
    @NotNull(message = "修理失败次数" + CustomMessages.NOT_NULL)
    @ApiModelProperty(value = "修理失败次数")
    private Integer failTimes;

    /**
     * 穿戴状态
     */
    @Range(min = 0, max = 1, message = "穿戴状态" + CustomMessages.ILLEGAL)
    @NotNull(message = "穿戴状态" + CustomMessages.NOT_NULL)
    @ApiModelProperty(value = "穿戴状态", required = true)
    private Integer wearStatus;

    /**
     * 打造类型
     */
    @Positive(message = "打造类型" + CustomMessages.ILLEGAL)
    @NotNull(message = "打造类型" + CustomMessages.NOT_NULL)
    @ApiModelProperty(value = "打造类型", required = true)
    private Integer forgeType;

    /**
     * 角色ID
     */
    @Pattern(regexp = RegExps.ROLE_ID, message = "角色ID" + CustomMessages.ILLEGAL)
    @NotBlank(message = CustomMessages.ROLE_ID_NOT_NULL)
    @ApiModelProperty(value = "角色ID", required = true)
    private String roleId;

    /**
     * 装备特技ID
     */
    @PositiveOrZero(message = "装备特技ID" + CustomMessages.ILLEGAL)
    @NotNull(message = "装备特技" + CustomMessages.ID_NOT_NULL)
    @ApiModelProperty(value = "装备特技ID", required = true)
    private Integer tejiId;

    /**
     * 装备特效ID
     */
    @PositiveOrZero(message = "装备特效ID" + CustomMessages.ILLEGAL)
    @NotNull(message = "装备特效" + CustomMessages.ID_NOT_NULL)
    @ApiModelProperty(value = "装备特效ID", required = true)
    private Integer texiaoId;

    /**
     * 装备类型ID
     */
    @Positive(message = "装备类型ID" + CustomMessages.ILLEGAL)
    @NotNull(message = "装备类型" + CustomMessages.ID_NOT_NULL)
    @ApiModelProperty(value = "装备类型ID", required = true)
    private Integer categoryId;

    /**
     * 附灵状态
     */
    @Range(min = 0, max = 1, message = "附灵状态" + CustomMessages.ILLEGAL)
    @NotNull(message = "附灵状态" + CustomMessages.NOT_NULL)
    @ApiModelProperty(value = "附灵状态", required = true)
    private Integer fulingStatus;
}